package com.hsy.crm.web.service.impl;

import com.hsy.crm.web.domain.cm.App;
import com.hsy.crm.web.domain.cm.PageResult;
import com.hsy.crm.web.domain.cm.Unified;
import com.hsy.crm.web.domain.entity.Resubject;
import com.hsy.crm.web.domain.po.resubject.ResubjectPagePo;
import com.hsy.crm.web.domain.vo.resubject.ResubjectPageVo;
import com.hsy.crm.web.mapper.ResubjectMapper;
import com.hsy.crm.web.service.base.BaseService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.hsy.crm.web.domain.cm.App;
import com.hsy.crm.web.domain.cm.PageResult;
import com.hsy.crm.web.domain.cm.Unified;
import com.hsy.crm.web.domain.entity.Resubject;
import com.hsy.crm.web.domain.po.resubject.ResubjectPagePo;
import com.hsy.crm.web.domain.vo.resubject.ResubjectPageVo;
import com.hsy.crm.web.mapper.ResubjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ResubjectService extends BaseService<Resubject> {

    @Autowired
    ResubjectMapper resubjectMapper;

    public PageResult<ResubjectPagePo> page(ResubjectPageVo resubjectPageVo) {
        Page page = PageHelper.startPage(resubjectPageVo.getPage(),resubjectPageVo.getLimit());
        PageResult<ResubjectPagePo> pageResult = new PageResult<>();
        pageResult.setRows(resubjectMapper.page(resubjectPageVo));
        pageResult.setTotal(page.getTotal());
        return pageResult;
    }

}
